import javax.servlet.http.Cookie
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
class CookieController {
//def pscontext = request.session.servletContext
    def index = {
        ///Cookie myCookie[]=request.getProperties()

        render servletContext.name;
        render servletContext.testvalue;
	render servletContext.getAttribute("msi"+cookie(name:"agentid"));
    }
    def setcookie = {
Cookie namecookie = new Cookie("mycookie","testww")
namecookie.setMaxAge(60*60*24*30);
response.addCookie(namecookie)
render namecookie.getValue();
servletContext.setAttribute("name","sasa");
servletContext.testvalue="sss";
    }
}
